#ifndef CVIMAGE_H
#define CVIMAGE_H

#include <QLabel>
#include <QUrl>
#include <QStyleOption>
#include <QPainter>
#include <QMap>

#include "http/cvimagehttp.h"
class CVImage : public QLabel
{
    Q_OBJECT
public:
    explicit CVImage(QWidget *parent);
    
    QUrl getImageUrl();

protected:
    void mouseReleaseEvent(QMouseEvent *ev);
signals:
    void clicked(CVImage *image);
public slots:
    void setImageUrl(const QString &strUrl, bool isUserIcon = true);
    void setImageUrl(QUrl url, bool isUserIcon = true);
private:
    QUrl mImageUrl;

    CVImageHttp *http;
};

#endif // CVIMAGE_H
